#ifndef TESTWIDGETD_H
#define TESTWIDGETD_H

#include <QWidget>
#include <QMouseEvent>
#include "a_active/activehandler.h"
#include "ui_active/dialogremoteconnecterror.h"
#include "ui_active/dialoginputpasswd.h"
class ScreenLook : public VPxDecoder
{
    Q_OBJECT
public:
    explicit ScreenLook(DeviceInfo *deviceInfo,QWidget *parent = nullptr);
    ~ScreenLook();
    void init(DeviceInfo *deviceInfo);
    ActiveHandler *activeHandler;
    DeviceInfo *qtyInfo;
public slots:
    void setPicSize(int width, int height);
    void finishedSockeHandler();
    void connStatusHandler(bool conn);
    void showNotErrorDlg(QString tips);
    void showInputPasswdDlgHandler();
    void passConnect(QString password);
signals:
    void closeSignal();
    void requestAuth(QString targetId, QString targetPasswd);
    void sendLeaveLook();
    void mouseMoveSend(QPoint point);
    void sendMouseKeys(int code,bool state);
    void sendWheelEvent(bool deltaPos);
    void sendKeyboard(int code,bool state);
protected:
    void mouseMoveEvent(QMouseEvent *event) override;
    void mousePressEvent(QMouseEvent *event) override;
    void mouseReleaseEvent(QMouseEvent *event) override;
    void wheelEvent(QWheelEvent *event) override ;
    void mouseDoubleClickEvent(QMouseEvent *event) override;
    void keyPressEvent(QKeyEvent * event) override;
    void keyReleaseEvent(QKeyEvent * event) override;

    void closeEvent(QCloseEvent *event) override;
private:
    int m_imageWidth ;
    int m_imageHeight;
    //鼠标左键，右键
    int code ;
    //鼠标按下松开
    bool state ;
    //对话框
    DialogRemoteConnectError dlg_remoteErrror;
    //对话框
    DialogInputPasswd dlg_inputpasswd;

};

#endif // TESTWIDGETD_H
